/**
 * Created by wei on 17/11/23.
 */


import React, { Component } from 'react';

class Info extends  Component{

    constructor(props){
        super(props);
        this.state = {
            informations: [],
        }
    }

    componentWillReceiveProps(nextProps){
        const {informations} = nextProps;
        this.setState({
            informations: informations,
        });
    }


    render(){

        let infomation;
        if(this.state.informations && this.state.informations.length>0){
            infomation = this.state.informations.map(function (v, i, arr) {
                let notify;
                if(v.status === 1){
                    notify = (
                        <div className="notify">&nbsp;</div>
                    );
                }
               return(
                  <div style={{position:'relative',marginLeft:'10px'}}>
                        {notify}
                        <div dangerouslySetInnerHTML={{__html: v.content}}>

                        </div>
                        <div className="comments_header"></div>
                  </div>)
            })
        }

        return (
            <div style={{height:'210px',overflowY:'scroll'}}>
                {infomation}
            </div>
        );
    }

}

export default Info;
